<template>
  <div>
    <el-table
      :data="eqrepairList"
      stripe
      style="width: 100%"
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55"></el-table-column>
      <el-table-column type="index" label="序号" width="50"></el-table-column>
      <el-table-column prop="hash.ep_ename" label="设备名称"></el-table-column>
      <el-table-column prop="hash.scale" label="规格型号"></el-table-column>
      <el-table-column prop="hash.managenum" label="管理编号"></el-table-column>
      <el-table-column prop="hash.sqtime" label="申请时间"></el-table-column>
      <el-table-column prop="hash.sqrname" label="申请人"></el-table-column>
      <el-table-column prop="hash.repair_typename" label="处理方式"></el-table-column>
      <el-table-column label="审核状态">
        <template slot-scope="scope">
          <div v-if="scope.row.hash.status==0">待审核</div>
          <div v-if="scope.row.hash.status==1" style="color:#26a2ff">通过</div>
          <div v-if="scope.row.hash.status==3" style="color:#26a2ff">已上传记录</div>
        </template>
      </el-table-column>
      <el-table-column prop="hash.sq_content" label="故障现象和维修要求" width="150"></el-table-column>
      <div v-if="islast">
        <el-table-column prop="hash.repair_amount" label="维修费用" width="150"></el-table-column>
        <el-table-column label="是否存档" width="100">
          <template slot-scope="scope">
            <div
              v-if="scope.row.hash.issave=='1'"
              style="background:#333;color:#fff;text-align:center"
            >是</div>
            <div v-else style="background:red;color:#fff;text-align:center">否</div>
          </template>
        </el-table-column>
      </div>
    </el-table>
    <el-pagination
      @current-change="handleCurrentChange"
      :currentPage.sync="pagobj.currentPage3"
      :pageSize="pagobj.pagesize"
      layout="total, prev, pager, next"
      :total="pagobj.total"
      style="margin:20px 0;text-align:center"
    ></el-pagination>
  </div>
</template>

<script>
import searchperson from "~/components/common/searchperson.vue";
import upload2 from "~/components/common/upload2.vue";

export default {
  components: {
    searchperson,
    upload2
  },
  props: {
    pagobj: {
      type: Object,
      required: true
    },
    eqrepairList: {
      type: Array,
      required: true
    },
    choosedp: Array,
    ismanager: Boolean,
    islast: Boolean
  },
  data() {
    return {
      ts: this.newStore()
    };
  },
  methods: {
    isselectable(row) {
      if (row.hash.status == 0) {
        return 1;
      }
      return 0;
    },
    handleCurrentChange() {
      this.$parent.geteqrepairlist();
    },
    handleSelectionChange(val) {
      this.$emit("update:choosedp", val);
    }
  }
};
</script>
<style >
.el-form-item {
  width: 50%;
  margin-bottom: 22px;
  float: left;
}
</style>

